#!/usr/bin/env fish

# Skip when it's not a branch checkout
#   i.e. grstr  == git restore --staged
#   also, git checkout -- file
set is_branch "$argv[3]" # 1 means branch, 0 means no
if test "$is_branch" = 0
    # FYI get rid of this output once I am happy with this hook not triggering
    echo "skipping post-checkout hook b/c no branch set: '$is_branch'"
    exit 0
end

echo "$(status current-filename) $argv"

# make clean && make tags
rag_indexer --githook
